﻿using MediatR;
using S.RBAC.Domain.Model;
using S.RBAC.Infrastructure.Interface;
using S.RBAC.Read.Api.Application.Command.StationCommand;

namespace S.RBAC.Read.Api.Application.CommandHandlers.StationHandler
{
    public class StationGetAllCommandHandler : IRequestHandler<StationGetAllCommand, List<Station>>
    {
        protected readonly IStationRepository _station;

        public StationGetAllCommandHandler(IStationRepository station)
        {
            _station = station;
        }

        public async Task<List<Station>> Handle(StationGetAllCommand request, CancellationToken cancellationToken)
        {
            return await _station.GetAllStations();
        }
    }
}
